package com.bootdo.bj.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.bootdo.bj.dao.ContextDao;
import com.bootdo.bj.domain.Context;
import com.bootdo.bj.service.ContextService;



@Service
public class ContextServiceImpl implements ContextService {
	@Autowired
	private ContextDao contextDao;
	
	@Override
	public Context get(Long id){
		return contextDao.get(id);
	}
	
	@Override
	public List<Context> list(Map<String, Object> map){
		return contextDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return contextDao.count(map);
	}
	
	@Override
	public int save(Context context){
	
		if(context.getId() != null) {
			return contextDao.update(context);
		}else {
			return contextDao.save(context);
		}		
	
		
	}
	
	@Override
	public int update(Context context){
		return contextDao.update(context);
	}
	
	@Override
	public int remove(Long id){
		return contextDao.remove(id);
	}
	
	@Override
	public int batchRemove(Long[] ids){
		return contextDao.batchRemove(ids);
	}
	
}
